using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
using PowerManage.Entity.Utils;

namespace PowerManage.Entity.Dtos.Auths;

/**
 * 认证登录参数
 */
public class AuthLoginDto
{
    /**
     * 用户名
     */
    [Required]
    [StringLength(20, MinimumLength = 3)]
    public string UserName { get; set; }

    /**
     * 密码
     */
    [Required]
    [StringLength(20, MinimumLength = 6)]
    [JsonConverter(typeof(DesensitizationConverter), 2, 3)] //保留前面2位字符，隐藏中间3个字符
    public string Password { get; set; }

    /// <summary>
    /// 验证码Key
    /// </summary>
    [Required]
    public string CodeKey { get; set; }

    /// <summary>
    /// 验证码
    /// </summary>
    [Required]
    public string Code { get; set; }
}